KILLER WOLF'S PROFILE
Killer Wolf
1235
When you're bound by your own convictions, a discipline can be your addiction.
Search
Filter
Auto Revive
author=zergar
Yes that's very helpful, but can I modify it in a way that the common event is linked to the Knockout state so when the character is killed it checks for the item in question in their inventory and if so it removes the item from inventory and brings the character back to life without triggering the gameover screen?
If you're using XP, you could probably find someone to help you script a much smoother auto-life than the ones I can event in 2k3. That said, you could easily make an event that checks if a character is unconscious and then checks to see if a certain item is in the party's inventory. If character status = "knocked out" then if item = "Revive Stone" is in party inventory, revive the character and reduce the item count by one.
Of course, as was mentioned above, if you try this in a battle with only one player, it would be problematic. (Again, this is based on how 2k3 handles things. I am not familiar with XP). There should be a way, probably making the actual battle occur with a If Victory / If Defeat Fork. Have defeat check for the revive item, and restore the character's life.
Of course, in THAT case, you would revive outside of battle. You COULD track enemy stats through variables and "re-start" the battle, setting them back to the hp and mp values they had before the character "died."
Chana- I thought the joke was clever. =)
Counter Attack in RPG Maker 2003?
It just takes some eventing. If you just want a character to strike back at ANY enemy when damaged, that is a little easier than making them target the one who wounded them specifically.
The easy way -
Track the character's hp through variables in a battle event that triggers every 1x rounds. Make two variables for each character who can counter: Old HP & New HP. You might also need a transfer variable, we'll call it TempVar.
The first round, Old HP should be 0.
If Old Hp = 0, set Old Hp = Character's Hp
If Old HP =/= 0 then
>>set New HP = Character's HP
>>>>If New HP < Old Hp
>>>>Turn on switch CharacterCounter.
>>>>End if
>>Set Old Hp = Character's Hp
end if
Have a battle event triggered by the switch CharacterCounter.
Use variables to record the attack strength of the character.
Use a randomize variable to select a target from the enemy group. You need some redundancy here to keep track of which enemies are still alive and change the targeting accordingly.
Get the target's defense and subtract that from the attack value in the variable.
Inflict a status on the countering character to make them invisible while you play the attacking animation on the selected target.
Subtract the attack variable from the target's hp, remember to allow Hp reduction to kill the target.
Cancel the invisibility status
Turn off Character Counter switch.
NOTE:
Set up this way, a character that was poisoned would always counter attack. You could figure the HP reduction for poison manually, and check to see if the character's hp decreased by a greater amount. You'd have to track whether the character was poisoned or not through a common event.
Most game's don't let characters counter attack EVERY time, at least not without some upgrades. You could add in a randomize check so that the character only attacked when he rolled over a certain threshold.
If you wanted to attack the individual enemy that attacked the character, you would probably need to have your enemy attacks and skills set up as switches that find their target through battle events so you can keep track of who is getting hit with what.
Not difficult, just time consuming.
The easy way -
Track the character's hp through variables in a battle event that triggers every 1x rounds. Make two variables for each character who can counter: Old HP & New HP. You might also need a transfer variable, we'll call it TempVar.
The first round, Old HP should be 0.
If Old Hp = 0, set Old Hp = Character's Hp
If Old HP =/= 0 then
>>set New HP = Character's HP
>>>>If New HP < Old Hp
>>>>Turn on switch CharacterCounter.
>>>>End if
>>Set Old Hp = Character's Hp
end if
Have a battle event triggered by the switch CharacterCounter.
Use variables to record the attack strength of the character.
Use a randomize variable to select a target from the enemy group. You need some redundancy here to keep track of which enemies are still alive and change the targeting accordingly.
Get the target's defense and subtract that from the attack value in the variable.
Inflict a status on the countering character to make them invisible while you play the attacking animation on the selected target.
Subtract the attack variable from the target's hp, remember to allow Hp reduction to kill the target.
Cancel the invisibility status
Turn off Character Counter switch.
NOTE:
Set up this way, a character that was poisoned would always counter attack. You could figure the HP reduction for poison manually, and check to see if the character's hp decreased by a greater amount. You'd have to track whether the character was poisoned or not through a common event.
Most game's don't let characters counter attack EVERY time, at least not without some upgrades. You could add in a randomize check so that the character only attacked when he rolled over a certain threshold.
If you wanted to attack the individual enemy that attacked the character, you would probably need to have your enemy attacks and skills set up as switches that find their target through battle events so you can keep track of who is getting hit with what.
Not difficult, just time consuming.
Auto Revive
Check in this topic -
http://rpgmaker.net/forums/topics/10040/
There's a revive outline you could probably adapt into what you are looking for.
http://rpgmaker.net/forums/topics/10040/
There's a revive outline you could probably adapt into what you are looking for.
Whatchu Workin' On? Tell us!
Some of the hands on the very bottom one are a little strange, but other than that, and the one you said you needed to clean up, very nice work!
Special Statuses [2K3]
Not if you only write to the REAL MAX HP variable when the character is not diseased.
Bob has 100 hp. He is healthy. Every tick of the game clock, a parallel common event records Bob's Max Hp into Bob'sRealMaxHp.
Bob is unlucky. He goes to a shady tavern and ends up heading home with the WRONG woman.
Bob gets diseased. The parallel common event stops recording Bob's Hp. Bob'sRealMaxHp will still be 100, but his Bob'sDiseasedHp will be 75. Set the character's max hp to Bob'sDiseasedHp.
Bob is very unlucky. He stubs his toe critically and then falls down the stairs. His hp is reduced to 25, and since he is diseased his MaxHp has to come down. An event will notice that Bob's Current HP is less than Bob'sDiseasedHp and reduce the stat accordingly.
Bob somehow manages to gain a level. Lets say that when Bob gets a level up while diseased, it adds to a variable called Bob'sLevelsWhileDiseased. With some math, you can figure out how much Hp Bob should have gained, if he wasn't diseased. You can figure this on the fly, or just record it into Bob'sHpGainWhileDiseased. You could even go ahead and add the number of Hp he should gain directly into Bob'sRealHp if you don't want to make a billion extra variable calls.
During his level-up, Bob tags Medicine.
Bob manufactures some Penicillin.
Bob consumes Penicillin, curing him of his disease.
When Bob is not diseased, his current Hp is checked against Bob'sRealHp. His current Hp is less, so it is adjusted up to Bob'sRealHp. You just have to check to see if his HP is less than his non-diseased HP before you allow the event to start recording again. If you added his level hp gain into his Real stat, job done. If not, just add it back in at this point, and the next tick of the internal clock, it will be reflected in the new Bob'sRealHp variable.
Hopefully Bob is more careful about whom he elects to take home next time.
Bob has 100 hp. He is healthy. Every tick of the game clock, a parallel common event records Bob's Max Hp into Bob'sRealMaxHp.
Bob is unlucky. He goes to a shady tavern and ends up heading home with the WRONG woman.
Bob gets diseased. The parallel common event stops recording Bob's Hp. Bob'sRealMaxHp will still be 100, but his Bob'sDiseasedHp will be 75. Set the character's max hp to Bob'sDiseasedHp.
Bob is very unlucky. He stubs his toe critically and then falls down the stairs. His hp is reduced to 25, and since he is diseased his MaxHp has to come down. An event will notice that Bob's Current HP is less than Bob'sDiseasedHp and reduce the stat accordingly.
Bob somehow manages to gain a level. Lets say that when Bob gets a level up while diseased, it adds to a variable called Bob'sLevelsWhileDiseased. With some math, you can figure out how much Hp Bob should have gained, if he wasn't diseased. You can figure this on the fly, or just record it into Bob'sHpGainWhileDiseased. You could even go ahead and add the number of Hp he should gain directly into Bob'sRealHp if you don't want to make a billion extra variable calls.
During his level-up, Bob tags Medicine.
Bob manufactures some Penicillin.
Bob consumes Penicillin, curing him of his disease.
When Bob is not diseased, his current Hp is checked against Bob'sRealHp. His current Hp is less, so it is adjusted up to Bob'sRealHp. You just have to check to see if his HP is less than his non-diseased HP before you allow the event to start recording again. If you added his level hp gain into his Real stat, job done. If not, just add it back in at this point, and the next tick of the internal clock, it will be reflected in the new Bob'sRealHp variable.
Hopefully Bob is more careful about whom he elects to take home next time.
Special Statuses [2K3]
Only record the Max HP into the "Real Max HP" stat when the character's status is NOT diseased. That way, any time the character is diseased, you CAN'T overwrite to the Real Max HP variable.
Division by zero error
I've had it occur very randomly in the past. I've also noticed that sometimes the player can glitch through the enemy and end up stuck on the left side of the screen when the battle ends.
As far as I could tell, the divide by zero crash seemed to occur when a party member and enemy acted at (virtually) the same time. Using the WAIT option instead of ACTIVE seems to have removed it from the project I was encountering it in.
As far as I could tell, the divide by zero crash seemed to occur when a party member and enemy acted at (virtually) the same time. Using the WAIT option instead of ACTIVE seems to have removed it from the project I was encountering it in.
Special Statuses [2K3]
Death sentence would be easy with the architecture already in place. Check to see if the character has the status and turn on a switch. When the switch is on, use a battle event to check for all actions the player can take. When player uses FIGHT command, ITEM, DEFEND, etc. Whenever the player acts, add one to a variable. When the variable reaches the turn limit for Doom/Death Sentence, kill the character.
Checking it when the character acts is better then checking it in your 1x turn event, since THAT would count the turns of every unit in battle. If you have 4 enemies and 3 player characters, a 5 turn death sentence might as well be an automatic kill.
Checking it when the character acts is better then checking it in your 1x turn event, since THAT would count the turns of every unit in battle. If you have 4 enemies and 3 player characters, a 5 turn death sentence might as well be an automatic kill.
Special Statuses [2K3]
It looks like you're setting the Max HP and Diseased Max Hp at the same time. The way the event is written, it looks like it would never trigger. You should only set the REAL Max Hp when the character is NOT diseased.
You might need an extra variable.
REAL Max Hp, OLD Diseased Max HP, NEW Diseased Max Hp.
You might need an extra variable.
REAL Max Hp, OLD Diseased Max HP, NEW Diseased Max Hp.













